For fast query processing, some database systems, such as in-memory database (IMDB) systems, employ a number of caches to avoid repeated expensive computation. As a result of using such caches, query response times are reduced. Caches are currently used for a number of applications or use cases of applications, such as, e.g. query results of the column store, models of the calculation engine, hierarchies, or query plans.
The cached entries usually depend on other data. For example, a query result depends on referenced tables and views (and recursively on further views or tables). As some IMDB systems realize transaction-consistent snapshots as part of their multi-version concurrency control (MVCC), in which the cached content must be invalidated if any of the sources of a cached entry changes. Essentially, some changes of a cached entry require a cache replacement strategy. The cache replacement strategy is used when the cache is full, but new entries should be inserted. Based on the replacement strategy, old entries are removed to make space for new entries. Potentially, caches will need to offer access to older, invalid snapshots.
One challenge of transaction-consistent caches is the need to implement an efficient invalidation mechanism that is also extensible, to support different kinds of cached objects and different types of dependencies including tables, view definitions, or privileges.
Both query result caching and materialized views are techniques that are used to speed up query performance for common sub-expressions. However, caching does not require prior modeling of the materialized entries. On the other hand, sophisticated techniques to match view definitions to queries do exist for better reusability of materialized data. Techniques for matching cached content are typically not as powerful as those for matching views or indices. Both materialized views and caches require updates or invalidation in the presence of changes applied to the base data.